Register oauth clients with a preferred auth method #642
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR registers oauth clients with a
token_endpoint_auth_method
as preferred by the authorization server metadatatoken_endpoint_auth_methods_supported
field, instead of always sendingnone
.If the authorization server expresses multiple preferences in
token_endpoint_auth_methods_supported
, the first match from:client_secret_basic, client_secret_post, none
is picked. If no preference is expressed,none
is picked. Unknown values are ignored.I don't see any tests around client registration, unfortunately. I could add some with a little help from you experts!
Motivation and Context
Some MCP clients (e.g. vscode) don't currently support any token endpoint auth (microsoft/vscode#257277), but the MCP SDKs do (modelcontextprotocol/typescript-sdk#720). Without this change, one has to guess at when clients actually support token endpoint auth based on other metadata or simply always use None.
How Has This Been Tested?
I tested this locally with my MCP server and authorization server, stepping through the inspector's guided flow to check that client registration matches expectations.
Breaking Changes
No, existing authorization server preferences continue to be respected.
Types of changes
Checklist
Additional context